package com.hwadee.job.controller;

import java.io.File;
import java.io.IOException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import com.hwadee.job.entity.Resume;
import com.hwadee.job.entity.StudentInfo;
import com.hwadee.job.entity.User;
import com.hwadee.job.service.ResumeService;
import com.hwadee.job.service.StudentService;
import com.hwadee.job.service.UserService;
import com.hwadee.job.util.Utils;

@RequestMapping("/student")
@Controller
public class StudentController {

	@Autowired
	private StudentService studentService;
	@Autowired
	private UserService userService;
	@Autowired
	private ResumeService resumeService;
	
	@GetMapping("/intro")
	public String stuIntro() {
		return "student/intro";
	}
	@GetMapping("/index")
	public String stuIndex() {
		return "student/index";
	}
	@GetMapping("/search")
	public String search() {
		return "student/search";
	}
	
//	@GetMapping("/centre")
//	public String stuCentre() {
//		return "student/centre";
//	}
	
	@GetMapping("/centre")
	public String stuXinxi(Model model,HttpServletRequest request,HttpSession session) {
		User user=(User) session.getAttribute("user");
		StudentInfo student=studentService.selectName(user.getuName());
		model.addAttribute("stu", student);
		return "student/centre";
	}
	
	
	
	
}
